#ifndef INPUT_H
#define INPUT_H

#include "Keyboard.h"
#include "Mouse.h"

namespace Cvekas {

/// %Input component. Gives access to all input devices, manages them
class Input : public boost::noncopyable
{
public:
	/// Constructor
	/// \param handle Aplication window handle. Usually provided by Window::getHandle()
	/// \throws Exception On unsucessful DirectInput8 initialization
	Input(HWND handle);

	/// Destructor
	virtual ~Input();
	
	/// Returns pointer to Keyboard. Initializes DirectInput keyboard on first call
	KeyboardPtr getKeyboard();
	
	/// Returns pointer to Mouse. Initializes DirectInput mouse on first call
	MousePtr getMouse();

	/// Reads win32 message, updates input state according to it.
	/// \returns true if message was processed.
	bool process(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

private:
	/// Handle to aplication window
	const HWND win_handle;

	/// Keyboard
	KeyboardPtr keyboard;
	/// Mouse
	MousePtr mouse;
};

typedef boost::shared_ptr<Input> InputPtr;

} // namespace

#endif